﻿using System.Xml.Serialization;

namespace Toybox.NicoSharp.RSS
{
	using Primitives;

	[XmlRoot("rss")]
	public class LiveRSS : AbstractLiveRSS
	{

		#region [Static]

		public static LiveRSS Get()
		{
			string url = NicoUrls.LiveTop + "rss";
			return Get<LiveRSS>(url);
		}

		#endregion [Static]


		#region Public Members

		public Channel channel;

		#endregion Public Members


		#region [SubClass]

		public class Channel : AbstractChannel
		{
			/// <summary>
			/// アイテム
			/// </summary>
			[XmlElement]
			public LiveItem[] item;
		}

		public class LiveItem : Item
		{
			/// <summary>
			/// サムネイル
			/// </summary>
			[XmlElement(Namespace = NAMESPACE_MEDIA)]
			public Thumbnail thumbnail;

			/// <summary>
			/// 開場時間
			/// </summary>
			[XmlElement(Namespace = NAMESPACE_LIVE)]
			public string open_time;

			/// <summary>
			/// 開始時間
			/// </summary>
			[XmlElement(Namespace = NAMESPACE_LIVE)]
			public string start_time;

			/// <summary>
			/// 放送プロバイダ
			/// </summary>
			[XmlElement(Namespace = NAMESPACE_LIVE)]
			public ProviderType type;

			/// <summary>
			/// パスワード
			/// </summary>
			[XmlElement(Namespace = NAMESPACE_LIVE)]
			public bool password;

			/// <summary>
			/// プレミアム限定
			/// </summary>
			[XmlElement(Namespace = NAMESPACE_LIVE)]
			public bool premium_only;
		}

		#endregion [SubClass]

	}
}
